import Vue from 'vue'
import Vuex from 'vuex'
import VuexPersist from 'vuex-persist'
Vue.use(Vuex)

//持久化存储
const vuexLocal=new VuexPersist({
  storage:window.localStorage
})

export default new Vuex.Store({
  state: {
    can:{
      home:'首页'
    },
    userInfo:{

    }
  },
  mutations: {
    setCan(state,value){
      state.can=value;
    },
    setUser(state,value){
      state.userInfo=value
      // console.log(value)
    }
  },
  actions: {
  },
  modules: {
  },
  plugins:[vuexLocal.plugin]
})
